Optimal. Leaf size=99 \[ \frac{\left (A d^2-B c d+c^2 C\right ) \log (c+d \tan (e+f x))}{d f \left (c^2+d^2\right )}-\frac{(B c-d (A-C)) \log (\cos (e+f x))}{f \left (c^2+d^2\right )}+\frac{x (A c+B d-c C)}{c^2+d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.097683, antiderivative size = 99, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.121, Rules used = {3626, 3617, 31, 3475} \[ \frac{\left (A d^2-B c d+c^2 C\right ) \log (c+d \tan (e+f x))}{d f \left (c^2+d^2\right )}-\frac{(B c-d (A-C)) \log (\cos (e+f x))}{f \left (c^2+d^2\right )}+\frac{x (A c+B d-c C)}{c^2+d^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3626
Rule 3617
Rule 31
Rule 3475
Rubi steps
\begin{align*} \int \frac{A+B \tan (e+f x)+C \tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx &=\frac{(A c-c C+B d) x}{c^2+d^2}-\frac{(-B c+A d-C d) \int \tan (e+f x) \, dx}{c^2+d^2}+\frac{\left (c^2 C-B c d+A d^2\right ) \int \frac{1+\tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{c^2+d^2}\\ &=\frac{(A c-c C+B d) x}{c^2+d^2}-\frac{(B c-(A-C) d) \log (\cos (e+f x))}{\left (c^2+d^2\right ) f}+\frac{\left (c^2 C-B c d+A d^2\right ) \operatorname{Subst}\left (\int \frac{1}{c+x} \, dx,x,d \tan (e+f x)\right )}{d \left (c^2+d^2\right ) f}\\ &=\frac{(A c-c C+B d) x}{c^2+d^2}-\frac{(B c-(A-C) d) \log (\cos (e+f x))}{\left (c^2+d^2\right ) f}+\frac{\left (c^2 C-B c d+A d^2\right ) \log (c+d \tan (e+f x))}{d \left (c^2+d^2\right ) f}\\ \end{align*}
Mathematica [C] time = 0.213477, size = 117, normalized size = 1.18 \[ \frac{\frac{2 \left (A d^2-B c d+c^2 C\right ) \log (c+d \tan (e+f x))}{d \left (c^2+d^2\right )}+\frac{(-i A+B+i C) \log (-\tan (e+f x)+i)}{c+i d}+\frac{(i A+B-i C) \log (\tan (e+f x)+i)}{c-i d}}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.037, size = 234, normalized size = 2.4 \begin{align*} -{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Ad}{2\,f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Bc}{2\,f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Cd}{2\,f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{A\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{B\arctan \left ( \tan \left ( fx+e \right ) \right ) d}{f \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{C\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{d\ln \left ( c+d\tan \left ( fx+e \right ) \right ) A}{f \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ) Bc}{f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ){c}^{2}C}{f \left ({c}^{2}+{d}^{2} \right ) d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.45554, size = 143, normalized size = 1.44 \begin{align*} \frac{\frac{2 \,{\left ({\left (A - C\right )} c + B d\right )}{\left (f x + e\right )}}{c^{2} + d^{2}} + \frac{2 \,{\left (C c^{2} - B c d + A d^{2}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} d + d^{3}} + \frac{{\left (B c -{\left (A - C\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.22239, size = 269, normalized size = 2.72 \begin{align*} \frac{2 \,{\left ({\left (A - C\right )} c d + B d^{2}\right )} f x +{\left (C c^{2} - B c d + A d^{2}\right )} \log \left (\frac{d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) -{\left (C c^{2} + C d^{2}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \,{\left (c^{2} d + d^{3}\right )} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 14.0031, size = 966, normalized size = 9.76 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.62131, size = 147, normalized size = 1.48 \begin{align*} \frac{\frac{2 \,{\left (A c - C c + B d\right )}{\left (f x + e\right )}}{c^{2} + d^{2}} + \frac{{\left (B c - A d + C d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} + \frac{2 \,{\left (C c^{2} - B c d + A d^{2}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d + d^{3}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]